@import '../../../../styles/modules/all';

bookmark {
  @include box-shadow;

  border-radius: $border-radius-well;
  border-width: 0;
  display: block;
  margin: 0 0 0.75rem;
  max-height: 25rem;
  overflow: hidden;
  padding: 0;
  position: relative;
  transition: max-height 1s cubic-bezier(0, 1, 0, 1);

  &.ng-leave.ng-leave-active {
    margin-bottom: 0;
    max-height: 0;
    opacity: 0;
  }

  .bookmark-content {
    background-color: var(--color-bookmark-bg);
    border-radius: $border-radius-well;
    padding: 0.5rem 1rem 0.75rem;
    transition: background-color ease-in-out 0.2s;

    .bookmark-heading {
      @include text-overflow-ellipsis;

      color: var(--color-bookmark-heading);
      font-size: 1.2rem;
      font-weight: 400;
      line-height: 1.75rem;
      margin-bottom: 0;
      margin-right: 1.5rem;
      position: relative;
      transition: color ease-in-out 0.2s;
    }

    .bookmark-text {
      color: var(--color-bookmark-text);

      .description {
        font-size: 0.9rem;
        font-style: italic;
        line-height: 1.15rem;
      }

      .url {
        color: var(--color-bookmark-url);
        font-size: 0.85rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: 100%;
      }
    }
  }

  .btn-edit-bookmark {
    opacity: 0;
    position: absolute;
    right: 1rem;
    top: 0.75rem;

    @media (hover: hover) {
      &:hover {
        opacity: 1 !important;
      }
    }
  }

  .menu {
    background-color: var(--color-bookmark-menu-bg);
    border-radius: $border-radius-well;
    display: flex;
    height: 100%;
    justify-content: center;
    position: absolute;
    text-align: center;
    user-select: none;
    width: 100%;
    z-index: 60;

    icon-button {
      &.btn-delete-bookmark {
        button {
          background-color: var(--color-danger) !important;
          color: var(--color-bookmark-menu-button-delete-icon) !important;
        }
      }

      button {
        background-color: var(--color-bookmark-menu-button-bg) !important;
        color: var(--color-bookmark-menu-button-icon) !important;
        position: static !important;
      }
    }

    .buttons {
      align-items: center;
      display: flex;
      height: 100%;
      justify-content: space-around;
      max-width: 25rem;
      width: 100%;
    }
  }

  .separator {
    background-color: var(--color-separator-bg);
    box-shadow: none;
    height: 0.5rem;

    @media (hover: hover) {
      &:hover {
        cursor: default;
      }
    }
  }

  @media (hover: hover) {
    &:focus,
    &:hover {
      & > .bookmark-content {
        background-color: var(--color-bookmark-bg-hover);
      }
    }

    &:hover {
      cursor: pointer;

      & > .btn-edit-bookmark {
        opacity: 0.8;
      }
    }
  }
}
